/*  实验二源程序 */
// 清单2-1  创建进程
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>

int main()
{
    int x;
    srand((unsigned)time(NULL));
    while ((x = fork()) == -1);

    if (x == 0)
    {
        sleep(rand() % 2);
        printf("a\n");
    }
    else
    {
        sleep(rand() % 3);
        printf("b\n");
    }
    printf("c\n");
}